package com.zhuang.observer.observable_example;

import java.util.Observable;
import java.util.Observer;

/**
 * @Classname Policemen
 * @Description 警察类 实现Observe类  实现update方法
 * @Date 2021/3/28 14:36
 * @Created by dell
 */

public class Policemen implements Observer {

    private String name;

    public Policemen(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Policemen() {
    }

    @Override
    public void update(Observable o, Object arg) {
        System.out.println("警察：" + ((Thief) o).getName() + "你被我抓到了哈哈哈哈！！！");
    }
}
